//患者队列
$(document).ready(function () {


    $(".doctor li:eq(0) div").show()


    $(".doctor li p button").click(function () {

        $(".doctor li div").hide();
        $(this).parent().next("div").show()


        // $(this).next().show();
    })

    // 确认问诊
    $(".bangding").on("click", " #ok", function () {
        var up = $(this).parent().parent().children("td:eq(0)").text()
        swal({
                title: "确定问诊吗？",
                text: "问诊状况",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#6ad5fd",
                confirmButtonText: "确定！",
                cancelButtonText: "取消！",
                closeOnConfirm: false,
                closeOnCancel: false
            },
            function (isConfirm) {
                if (isConfirm) {
                    $.ajax({
                        url: "http://localhost:8080/doctorg/update",
                        type: "post",
                        data: {
                            id: up
                        },
                        dateType: "json",
                        success: function (data) {
                            swal("问诊成功");
                            location.reload();
                        }
                    })
                } else {
                    swal("取消！", ":)",
                        "error");
                }
            });


    })
})

